package com.gq.business.reports.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.gq.business.reports.dto.ReportRequest;
import com.gq.business.reports.model.Report;
import com.gq.business.reports.service.ReposrtService;

@Controller
public class ReportController
{
    @Autowired
    private ReposrtService rs;
    
    @RequestMapping("getReport")
    public String getReport()
    {
        Report r = rs.getReportById("1");
        System.out.println(r.getDate());
        
        return "aa";
    }
    
    @ResponseBody
    @RequestMapping(value = "getRestReport")
    public Report getRestReport(@RequestBody ReportRequest rr)
    {
        Report r = new Report();
        System.out.println(rr.getBody().getDate());
        r.setDate("aaa");
        r.setRepoter("bb");
        return r;
    }
}
